home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Super PC 34
/
Super PC 34 (Shareware).iso
/
spc
/
UTIL
/
DJGPP2
/
V2
/
DJLSR200.ZIP
/
src
/
libc
/
pc_hw
/
kb
/
kbhit.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1995-06-04
|
380 b
|
22 lines
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#include <pc.h>
#include <libc/farptrgs.h>
#include <dpmi.h>
#include <go32.h>
int
kbhit(void)
{
__dpmi_regs r;
if (_farpeekw(_dos_ds, 0x41a) == _farpeekw(_dos_ds, 0x41c))
return 0;
r.h.ah = 0x11;
__dpmi_int(0x16, &r);
if (r.x.flags & 0x40) /* Z */
return 0;
return 1;
}